package cn.funeralobjects.aoss.enums;

import lombok.Getter;

/**
 * 版本控制状态
 *
 * @author FuneralObjects
 * Create date: 2020/6/1 11:26 AM
 */
public enum Versioning {
    /**
     * 启用
     */
    ENABLED("Enabled"),
    /**
     * 悬停
     */
    SUSPENDED("Suspended"),
    /**
     * 未知
     */
    UNKNOWN("Unknown");
    @Getter
    private final String code;

    Versioning(String code) {
        this.code = code;
    }


    public static Versioning of(String code) {
        if (code == null) {
            return null;
        }
        for (Versioning versioning : Versioning.values()) {
            if (versioning.code.equals(code)) {
                return versioning;
            }
        }
        return null;
    }
}
